package com.hx.myapp.datastorage;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.hx.myapp.R;

public class DataSrorageActivity extends AppCompatActivity implements View.OnClickListener {
    private Button mBtnSharedPreferences,mBtnFile;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_data_srorage);
        mBtnSharedPreferences = findViewById(R.id.btn_sharedpreferences);
        mBtnFile =findViewById(R.id.btn_file);

        mBtnSharedPreferences.setOnClickListener(this);
        mBtnFile.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent = null;
        switch (v.getId()){
            case R.id.btn_sharedpreferences:
                intent = new Intent(DataSrorageActivity.this,SharedPreferencesActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_file:
                intent = new Intent(DataSrorageActivity.this,FileActivity.class);
                startActivity(intent);
                break;
        }
    }
}